import React, { useEffect, useState, useRef } from 'react';

import { PopUp } from '@/components/UiComponents'
import Collect from '@/components/Collect'
import WpsCollect from '@/components/WpsCollect'
const MaskCollection = (props) => {
  const { visible = {}, onClose, } = props
  const { show = false, detail = {} } = visible
  const { oldFlag = '0' } = detail
  useEffect(() => {
  }, [show])
  if (show) {
    return <PopUp
      disableBodyScroll={false}
      getContainer={null}
      showCloseButton={show}
      onMaskClick={() => {
        onClose()
      }}
      onClose={() => onClose()}
      visible={show}>
      {oldFlag === '0' ? <Collect {...props} detail={detail}></Collect> : <WpsCollect {...props} detail={detail}></WpsCollect>}
    </PopUp>
  }
  else {
    return null
  }
}
export default MaskCollection